﻿using System;
using System.Web.Configuration;
using System.Data;

public partial class manager_eval_Detail : System.Web.UI.Page
{
    public int taskid = 0;
    DBHelper db = new DBHelper(WebConfigurationManager.ConnectionStrings["connString"].ConnectionString);
    protected void Page_Load(object sender, EventArgs e)
    {
        taskid = Convert.ToInt32(Request.QueryString["taskid"]);
        Edit_Id.Value = taskid.ToString();
        if (!IsPostBack)
        {
            loadEditData(taskid);
        }
    }
    private void loadEditData(int sid)
    {
        string sql = "select * from v_A_Task where id=" + sid;
        DataTable dt = db.getList(sql);
        if (dt.Rows.Count == 1)
        {

            txt_title.Value = dt.Rows[0]["title"].ToString();


            txt_title.Value = dt.Rows[0]["title"].ToString();
            txt_detail.Value = dt.Rows[0]["detail"].ToString();
            ZRR_psid_mc.Value = dt.Rows[0]["RY_zrr_GwMc"].ToString() + "|" + dt.Rows[0]["RY_zrr_Mc"].ToString();
            ZXR_psid_mc.Value = dt.Rows[0]["RY_zxr_GwMc"].ToString() + "|" + dt.Rows[0]["RY_zxr_Mc"].ToString();
            BKHR_psid_mc.Value = dt.Rows[0]["RY_bkhr_GwMc"].ToString() + "|" + dt.Rows[0]["RY_bkhr_Mc"].ToString();
            ddl_LX_sj.SelectedValue = dt.Rows[0]["LX_sj"].ToString();
            ddl_LX_kh.SelectedValue = dt.Rows[0]["LX_kh"].ToString();
            txt_rq_yjs.Value = dt.Rows[0]["rq_yjs"].ToString();
            txt_Tdata.Value = dt.Rows[0]["Tdata"].ToString();
            txt_bz_js.Value = dt.Rows[0]["bz_js"].ToString();



            string isusstr = "0";
            if (dt.Rows[0]["LX_sj"].ToString() == "True")
            {
                isusstr = "1";
                isdata.Value = "1";
            }
            ddl_LX_sj.SelectedValue = isusstr;

            isusstr = "0";
            if (dt.Rows[0]["LX_kh"].ToString() == "True")
            {
                isusstr = "1";
            }
            ddl_LX_kh.SelectedValue = isusstr;

            isusstr = "0";
            if (dt.Rows[0]["task_state"].ToString() == "True")
            {
                isusstr = "1";
            }
            ddl_task_state.SelectedValue = isusstr;


        }
    }



}